Skip to content

fix(runtime): include GET_SIGNATURES on all API 28+ archive reads - #851

Open
New-President wants to merge 1 commit into
Jman-Github:devfrom
New-President:fix/archive-signing-all-apis
Open

New-President wants to merge 1 commit into
Jman-Github:devfrom
New-President:fix/archive-signing-all-apis

Conversation

@New-President

Copy link
Copy Markdown

Summary

  • Always include PackageManager.GET_SIGNATURES alongside PackageManager.GET_SIGNING_CERTIFICATES in PM.getPackageInfo(File, includeSigning = true) on API 28+, instead of only on Build.VERSION.SDK_INT < Build.VERSION_CODES.R.
  • Update app/src/test/scripts/archive-signing-test.py to assert that GET_SIGNATURES is always included when includeSigning = true.

Root Cause

Commit c7b9fe12 (#839) added PackageManager.GET_SIGNATURES for SDK_INT < R (Android 9 and 10). However, several Android 11–13 OEM framework builds (verified by disassembling /system/framework/framework.jar on an Alldocube iPlay 50 running Android 13 / API 33, build T1030_V1.0_20240516) retain the legacy getPackageArchiveInfo condition:

if ((flags & PackageManager.GET_SIGNATURES) != 0) {
    PackageParser.collectCertificates(pkg, false);
}

When SDK_INT >= 30 passes GET_SIGNING_CERTIFICATES (0x08000000) without GET_SIGNATURES (0x00000040), (flags & 0x40) == 0 skips PackageParser.collectCertificates(pkg, false), leaving pkg.mSigningDetails uninitialized and returning PackageInfo with both signingInfo == null and signatures == null. That causes PatcherRuntimePluginRepository.archiveSigners() to throw:
SecurityException: Failed to read signer for app.universal.patch.manager.support.runtime

Passing GET_SIGNING_CERTIFICATES or GET_SIGNATURES on all API 28+ devices is completely harmless on standard AOSP Android 11+ and ensures collectCertificates runs on OEM builds that gate certificate collection on GET_SIGNATURES, while still populating PackageInfo.signingInfo for current signers and certificate rotation history.

- Always combine `PackageManager.GET_SIGNING_CERTIFICATES` with `PackageManager.GET_SIGNATURES` in `PM.getPackageInfo(File, includeSigning = true)` rather than restricting `GET_SIGNATURES` to `SDK_INT < R`.
- Several Android 11-13 OEM frameworks (such as Unisoc/Alldocube Android 13 `T1030_V1.0`) still gate `PackageParser.collectCertificates(pkg, false)` in `PackageManager.getPackageArchiveInfo()` purely on `(flags & PackageManager.GET_SIGNATURES) != 0` before checking `GET_SIGNING_CERTIFICATES`.
- Update `archive-signing-test.py` to verify that `GET_SIGNATURES` is always passed alongside `GET_SIGNING_CERTIFICATES`.
Copilot AI balanced review requested due to automatic review settings November 7, 2026 03:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@Jman-Github Jman-Github self-assigned this Nov 7, 2026
@Jman-Github Jman-Github added the Bug Something isn't working label Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants